import { useStore } from '@/store/store';
const store = useStore();
// 判断是否登录，未登录则隐藏手机号中间四位
export const formatPhoneNumber = (phone) => {
    const isLoggedIn = store.token
    const phoneStr = phone?.toString() || '';
    if (!isLoggedIn && phoneStr.length === 11) {
        return phoneStr.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
    }
    return phoneStr;
}